CMake Correctly set generated property on autogen source code #2132
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TYPE: bug fix
KEYWORDS: autogeneration, compilation, cmake
SOURCE: internal
DESCRIPTION OF CHANGES:
Problem:
Currently the CMake build system minimum version is limited by the automated scoping of generated property on certain source files. This in combination of
CMP0118
requires usage of CMake >3.20Solution:
Set the generated property at the correct scope for source file usage. Lower the minimum required version to reflect this change. Note that CMake 3.18.6 is not used as there are features from 3.19 in use that, while could be implemented by hand, would take more effort to remove than the gained benefit.
TESTS CONDUCTED:
project()
before beforeenable_language()
in CmakeLists.txt … #2125, CMake sanitize leading define flag #2130, and CMake Add documentation to custom defined properties #2131 this was tested on the latest patch of each unique minor release of CMake since v3.19.8. The full list of tested versions is as follows:v3.19.8
v3.20.6
v3.21.7
v3.22.6
v3.23.5
v3.24.4
v3.25.3
v3.26.6
v3.27.9
v3.28.6
v3.29.8
v3.30.5
v3.31.0
RELEASE NOTE:
Set the generated property on autogen source code explicitly in CMake and allow for lowered minimum CMake version of v3.19